<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<html>
<head>
    <meta charset="utf-8">
    <!-- 360浏览器极速模式 -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>棋盘管理</title>
    <%@ include file="/pages/common/head.jsp" %>
    <style>
        #container {
            display: flex;
        }

        #left_panel {
            flex: 0 0 600px;
        }

        #right_panel {
            position: relative;
            flex: 1;
        }

        table, td {
            border: 1px solid;
            border-collapse: collapse;
        }

        table {
            display: inline-block;
            width: 600px;
            height: 500px;
            overflow-y: scroll;
        }

        img {
            width: 100px;
            height: 60px;
        }

        #toUpload {
            position: relative;
            left: 10px;
        }
    </style>
</head>
<body>
<div id="container">
    <div id="left_panel">
        <table>
            <tr>
                <td>棋盘编号</td>
                <td>棋盘图片</td>
                <td>棋盘名</td>
                <td>价格</td>
                <td>上传者</td>
                <td>最后修改人</td>
                <td>购买数</td>
                <td>使用数</td>
                <td>上架时间</td>
                <td>操作</td>
            </tr>
            <c:forEach items="${requestScope.boardInfos}" var="boardInfo">
                <tr>
                    <td>${boardInfo.id}</td>
                    <td>
                        <img src="static/board_img/${boardInfo.name}.jpg" alt="">
                    </td>
                    <td>${boardInfo.name}</td>
                    <td>${boardInfo.price}</td>
                    <td>${boardInfo.uploaderName}</td>
                    <td>${boardInfo.modifierName}</td>
                    <td>${boardInfo.buyCount}</td>
                    <td>${boardInfo.useCount}</td>
                    <td>${boardInfo.uploadTime}</td>
                    <td>
                        <a href="boardServlet?action=toEdit&adminId=${requestScope.adminId}&boardId=${boardInfo.id}">修改</a>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </div>
    <div id="right_panel">
        <a href="boardServlet?action=toUpload&adminId=${requestScope.adminId}" id="toUpload">上传棋盘</a>
    </div>
</div>
</body>
</html>
